package unote.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import unote.common.CommonStrings;

public class DBUtil {

	private static DBUtil instance = null;

	private DBUtil() {
		InitDB.init();
	}

	public static DBUtil getInstance() {
		if (instance == null) {
			instance = new DBUtil();
		}

		return instance;
	}

	public Connection getConnection() {
		Connection conn = null;
		try {
			conn = DriverManager.getConnection(CommonStrings.DBUrl);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return conn;
	}
}
